#!/bin/bash

# testa che le lunghezze dei file di output  di testfrag2 siano accettabili

SCRIPTNAME=${0##*/}

if [ $# != 0 ] ; then
    echo ${SCRIPTNAME}: usage ${SCRIPTNAME}
    exit 1
else    
    w1=$(wc ./outminnie1 | tr -s " " | cut -f2 -d" ")
    w2=$(wc ./outciccio1 | tr -s " " | cut -f2 -d" ")
    w3=$(wc ./outpluto1 | tr -s " " | cut -f2 -d" ")

    if [ $(($w1 >=5 && $w1 <=15)) == "0" ] ; then
	echo  ${SCRIPTNAME}: odd length for outminnie1
	exit 1
    elif [ $(($w2 >=5 && $w2 <=15)) == "0" ] ; then
	echo  ${SCRIPTNAME}: odd length for outciccio1
	exit 1
    elif [ $(($w3 >=5 && $w3 <=15)) == "0" ] ; then
	echo  ${SCRIPTNAME}: odd length for outpluto1
	exit 1
    else
	echo  ${SCRIPTNAME}: out lengths OK
	exit 0
    fi
fi
